import { createBrowserRouter } from "react-router-dom";
import AuthLayout from "../pages/auth";
import Login from "../pages/login";
import Register from "../pages/register";
import UpdatePassword from "../pages/updatePassword";
import { Index } from "../pages/index";
import { UpdateInfo } from "../pages/updateInfo";
import { Menu } from "../pages/menu";
import Friendship from "../pages/friendship";
import Group from "../pages/group";
import Chat from "../pages/chat";
import Collection from "../pages/collection";
import Notification from "../pages/notification";

const router = createBrowserRouter([
    {
        path: "/",
        element: <Index></Index>,
        children: [
            {
              path: 'update_info',
              element: <UpdateInfo/>
            },
            {
              path: '/',
              element: <Menu/>,
              children: [
                {
                  path: '/',
                  element: <Friendship/>
                },
                {
                  path: '/group',
                  element: <Group/>
                },
                {
                  path: 'chat',
                  element: <Chat/>
                },
                {
                  path: 'collection',
                  element: <Collection/>
                },
                {
                  path: 'notification',
                  element: <Notification/>
                }
              ]
            }
          ]
    },
    {
        path: '/register',
        element: (
        <AuthLayout>
            <Register />
        </AuthLayout>)
    },
    {
        path: '/login',
        element: (
            <AuthLayout>
                <Login />
            </AuthLayout>)
    },
    {
        path: '/update_password',
        element:(
            <AuthLayout>
                <UpdatePassword/>
            </AuthLayout>
        )
    }

])




export default router;